import { PopupName } from "src/consts/popup_const";
import { OrganizationConst } from "src/consts/organization_const";
import { MyVue } from "src/wl/my_vue";

export default class ListHandler {
    rowAdd(row: any): void {
        WLCommit(OrganizationConst.CommitType, "add")

        let senData: any = {}
        senData["id"] = row.id
        WLDispatch(OrganizationConst.DispatchOrgShow, senData);
    }

    rowEdit(row: any): void {
        WLCommit(OrganizationConst.CommitType, "edit")

        let senData: any = {}
        senData["id"] = row.id
        WLDispatch(OrganizationConst.DispatchOrgShow, senData);
    }


    expand(row: any): void {
        let sendData: any = {}
        sendData["curr_page"] = WLStore().state.org.curr_page
        sendData["page_size"] = WLStore().state.org.page_size
        sendData.ind = row.id
        if (row.parent) {
            sendData.parent = row.id
        } else {
            sendData.parent = row.child_list[0].parent
        }

        WLDispatch(OrganizationConst.ExpandTree, sendData);
    }
}